package phonecompany.account;

import phonecompany.customer.Customer;
import phonecompany.phone.PhoneNumber;

/**
 * @since Oct 24, 2011
 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
 * @version $Id: UnlimitedCallsAccount.java 22 2011-10-24 10:52:28Z
 *          zexpp5@gmail.com $
 * 
 */
public final class UnlimitedCallsAccount extends PhoneAccount {
	private final int tariff1 = 10; // 10p per minute when balance above $15
	private final int tariff2 = 20; // 20p per minute when balance between $0
									// and $15
	private final int tariff3 = 50; // 50p per minute when balance below $0

	public UnlimitedCallsAccount(Customer holder, PhoneNumber phoneNumber) {
		super(holder, phoneNumber);
	}
	/**
	 * 
	 * (non-Javadoc)  
	 * @see phonecompany.account.PhoneAccount#getTariff()
	 */
	@Override
	public int getTariff() {
		if (this.getBalance() >= 15) {
			return tariff1;
		} else if (this.getBalance() < 0) {
			return tariff2;
		} else {
			return tariff3;
		}
	}
}
